<%@ page import="java.util.List" %>
<%@ page import="com.bean.Article" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>说说予录-博客首页</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/front/css/main.css">
</head>
<%--<body width="100%" background="${pageContext.request.contextPath}/front/images/sea.jpg" style="background-size: cover">--%>
<body>
<%--头部--%>
<%@include file="view/FrontTop.jsp"%>
<%--左边栏--%>
<div class="main">
    <%@include file="view/FrontLeft.jsp"%>
    <style>
        .right .article_item{
            margin: 20px 30px 0px 0px;
            border-radius: 10px;
            background: #F4F9FF;
        }
        .article_item .article_header{
            margin: 20px 30px 0px 0px;
            padding: 10px 5px 10px 15px;
        }
        .article_item .item_title{
            text-align: right;
            font-size: 13pt;
            font-weight: bold;
            color: #749b8e;
        }
        .article_item .time{
            text-align: right;
            line-height: 50px;
            font-size: 16px;
            display: block;
            margin: 0px 15px 0px 0px;
        }
        .article_item .item_body{
            display: flex;
            justify-content: space-between;
        }
        .article_item .item_body .item_content{
            margin: 0px 0px 0px 15px;
            width: 70%;
            line-height: 35px;
            overflow: hidden;
            word-wrap:break-word;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;/*行数*/
            -webkit-box-orient: vertical;
        }
        .article_item .item_body .look_more{
            width: 30%;
            /* display: flex; */
            /* justify-content: right; */
            /* align-items: end; */
            margin: 0px 10px 0px 0px;
            display: block;
            text-align: right;
            flex-direction: column;
        }
    </style>
    <div class="right">
        <%
            List articleList=(List)session.getAttribute("listarticle");
            if(articleList==null||articleList.size()==0){
        %>
        <tr height="100"><td align="center"><li>博主目前还未发表任何文章！</li></td></tr>
        <%
        }
        else{
            int i=0;
            while(i<articleList.size()){
                Article articleSingle=(Article)articleList.get(i);
        %>


                <div class="article_item">
                    <div class="article_header">
                        <span class="item_title"><%=articleSingle.getTitle()%></span>
                    </div>
                    <div class="item_body">
                        <div class="item_content"><%=articleSingle.getContent(50) %></div>
                        <div class="look_more"><a href="/Article?action=read&id=<%=articleSingle.getId()%>">阅读全文</a></div>
                    </div>
                     <div class="time">发表时间：<%=articleSingle.getPubtime() %> |评论：<%=articleSingle.getRemark() %>| 阅读：<%=articleSingle.getCount() %> 次</div>
                </div>

        <%
                    i++;
                }
            }
        %>
    </div>
</div>
<%--底部--%>
<%@include file="view/FrontEnd.jsp"%>
</body>
</html>
